
#include "utils.h"

#include <QtGui/QWidget>
#include <QtGui/QPaintEvent>
#include <QtGui/QImage>
#include <QtCore/QRect>

/*----------------------------------------------------------------------------*/
	
typedef std::vector< QRect > QRectV;

typedef std::vector< QImage > QImageV;

/*----------------------------------------------------------------------------*/

class ImageViewer
	:	public QWidget

/*----------------------------------------------------------------------------*/

{
	Q_OBJECT

/*----------------------------------------------------------------------------*/

public:

/*----------------------------------------------------------------------------*/

	ImageViewer( QWidget* _parent );

	~ImageViewer();

/*----------------------------------------------------------------------------*/

	void SetImage( QImage& _image );

	void CloseImage();	

	void SetLinesFrames( QRectV& _linesFrames );

	void SetWordFrames( QRectV& _wordsFrames );

	void SetSymbolFrames( QRectV& _symbolFrames );	

/*----------------------------------------------------------------------------*/

private:

/*----------------------------------------------------------------------------*/

	bool m_imageAvailable;

	bool m_showLinesFrames;

	bool m_showWordsFrames;

	bool m_showSymbolsFrames;

	QImage m_image;	

	QRectV m_linesFrames;

	QRectV m_wordsFrames;

	QRectV m_symbolFrames;

/*----------------------------------------------------------------------------*/

	void cleanUp();

	void paintEvent( QPaintEvent* );

/*----------------------------------------------------------------------------*/

private slots:

/*----------------------------------------------------------------------------*/

	void SetFramesShowing( bool _lines, bool _words, bool _symbols );

/*----------------------------------------------------------------------------*/

signals:

/*----------------------------------------------------------------------------*/

	void ImageAccessible( bool );

/*----------------------------------------------------------------------------*/

};

/*----------------------------------------------------------------------------*/
